/*
 * @Author: your name
 * @Date: 2022-03-09 16:52:21
 * @LastEditTime: 2022-04-27 03:17:23
 * @LastEditors: Please set LastEditors
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \vue-admin-template\src\utils\auth.js
 */
import Cookies from 'js-cookie'

const TokenKey = 'token'
const UserInfo = 'UserInfo'
const Routes = 'routes'

export function getToken() {
  return Cookies.get(TokenKey)
}

export function setToken(token) {
  return Cookies.set(TokenKey, token)
}

export function removeToken() {
  return Cookies.remove(TokenKey)
}
export function getUserInfoCookie() {
  return Cookies.get(UserInfo)
}

export function setUserInfoCookie(info) {
  return Cookies.set(UserInfo, info)
}

export function removeUserInfoCookie() {
  return Cookies.remove(UserInfo)
}
export function getRoutesSession() {
  return sessionStorage.getItem(Routes)
}

export function setRoutesSession(routes) {
  return sessionStorage.setItem(Routes, routes)
}

export function removeRoutesSession() {
  return sessionStorage.removeItem(Routes)
}
